package com.example.project.webControlleer;

import com.example.project.dao.ParkingDAO;
import com.example.project.dao.ParkingTypeDAO;
import com.example.project.dao.UserDAO;
import com.example.project.pojo.Parking;
import com.example.project.pojo.User;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import java.util.List;

@Controller
@RequestMapping("web")
public class WebShowPrivateParkingController {
    @RequestMapping("findPrivateParking")
    public String findPrivateParking(HttpSession session, Model model) {
        User user = (User) session.getAttribute("user");

        ParkingDAO parkingDAO = new ParkingDAO();
        List<Parking> List = parkingDAO.showPrivateParking(user);
        model.addAttribute("List", List);
        return "web/showPrivateParking";
    }


}
